home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / dev / basic / PureBasic.lha / PureBasic_Demo / PureBasic / Examples / FullVersion_Sources / Joypad.pb < prev    next >
Encoding:
Text File  |  2000-03-19  |  539 b   |  49 lines

  1. ;
  2. ; Joypad example for PureBasic !
  3. ;
  4.  
  5. If InitJoypad() = 0
  6.   PrintN("Can't use the joypads... Exit !")
  7.   End
  8. EndIf
  9.  
  10. a = 0
  11. Repeat
  12.   VWait()
  13.  
  14.   Result = JoypadMovement(1)
  15.  
  16.   If Result
  17.     PrintNumberN(Result)
  18.   Endif
  19.  
  20.   Buttons.l = JoypadButtons(1)
  21.  
  22.   If Buttons
  23.  
  24.     PrintNumber(10000)
  25.  
  26.     If Buttons & #PB_JOYPAD_BUTTON1
  27.       Print("Button 1 ")
  28.     EndIf
  29.  
  30.     If Buttons & #PB_JOYPAD_BUTTON3
  31.       Print("Button 2")
  32.     EndIf
  33.  
  34.     PrintN("")
  35.  
  36.   EndIf
  37.  
  38.   b.l = PressedRawKey()
  39.  
  40.   If b
  41.     PrintNumberN(b)
  42.   EndIf
  43.  
  44.   a+1
  45. Until a>500
  46.  
  47. End
  48.  
  49.